Cosmetic: Avoid an explicit state variable
authorMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 14:51:37 +0000 (09:51 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 14 Nov 2015 17:32:57 +0000 (12:32 -0500)
Using the state of the context makes it more obviously correct.

gtk/gtklistbox.c

index 82d759e14136532b333aa63cbcb5b1126aace4b8..9b963d97f9cbd94def1e4aa4ef4fa7037c3f64ce 100644 (file)
@@ -3141,21 +3141,20 @@ gtk_list_box_row_draw (GtkWidget *widget,
                        cairo_t   *cr)
 {
   GtkListBoxRow *row = GTK_LIST_BOX_ROW (widget);
-  GtkAllocation allocation = {0};
-  GtkStyleContext* context;
-  GtkStateFlags state;
-  GtkBorder border;
+  GtkAllocation allocation;
+  GtkStyleContext *context;
 
   gtk_widget_get_allocation (widget, &allocation);
   context = gtk_widget_get_style_context (widget);
-  state = gtk_widget_get_state_flags (widget);
 
   gtk_render_background (context, cr, 0, 0, allocation.width, allocation.height);
   gtk_render_frame (context, cr, 0, 0, allocation.width, allocation.height);
 
   if (gtk_widget_has_visible_focus (GTK_WIDGET (row)))
     {
-      gtk_style_context_get_border (context, state, &border);
+      GtkBorder border;
+
+      gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
       gtk_render_focus (context, cr, border.left, border.top,
                         allocation.width - border.left - border.right,
                         allocation.height - border.top - border.bottom);